import React from 'react';
import dynamic from 'dva/dynamic';
import { Route } from 'dva/router';
//import { Switch } from 'dva/router';
import { isToken } from '../utils/judgmentEquipment.js'

//import SearchBarMy from '../components/SearchBar/SearchBar';
//import NavBottomBar from '../components/NavBottomBar/NavBottomBar';

export default function homeRoute(app) {
    const Login = dynamic({
      app,
      models: () => {
        return [
          import(/* webpackChunkName: "loginModel" */'../models/login/loginModel'),
        ];
      },
      component: () => import(/* webpackChunkName: "login" */'../routes/login/login'),
    });
  // const MyRoute = dynamic({
  //   app,
  //   models: () => {
  //     return [
  //     //  import('../models/app/app'),
  //     ];
  //   },
  //   component: () => import('../routes/app/app'),
  // });
  const Home = dynamic({
    app,
    models: () => {
      return [
           import(/* webpackChunkName: "homeModel" */'../models/home/HomeModel'),
      ];
    },
    component: () => import(/* webpackChunkName: "home" */'../routes/home/Home')
  });

  // const SearchBarMy=dynamic({
  //   app,
  //   models: () => {
  //     return [
  //       //import('../models/homeModel/Home'),
  //     ]
  //   },
  //   component: () => import('../components/SearchBar/SearchBar'),
  // });


  // const GoodsClass = dynamic({
  //   app,
  //   models: () => {
  //     return [
  //       import('../models/goodsClass/goodsClassModel'),
  //     ];
  //   },
  //   component: () => import('../routes/goodsClass/goodsClass'),
  // });

  return (
    [
      <Route key="/" exact strict path="/" component={Home}/>
    ]
  );
}
